package com.lory.utils;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.velocity.tools.config.DefaultKey;
import org.apache.velocity.tools.config.ValidScope;

@DefaultKey("strings")
@ValidScope({"application","request", "session"})
public class StringsTool {

    /**
     * 判断字符串是否为空
     */
    public boolean isEmpty(String str){
       if (str == null || "".equals(str)){
           return true;
       }
       return false;
    }

    /**
     * 生成指定位数的数字字符串
     */
    public String randomNumberic(Integer num){
        return RandomStringUtils.randomNumeric(num);
    }
}
